<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{title}}</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script>
</head>
{% include 'menu.html' %}

<body>
<div class="container-fluid">
	<div class="row-fluid">
    	<div class="span2">
        	<ul class="nav nav-list">
            	<li class="nav-header"><h4 class="text-info">定位信息列表</h4></li>
                {% for coordinate in coordinates %}
                	<li 
                    {% if coordinate.now_time == index_time %}
                    	class="active"
                    {% endif %}
                    >
                <a href="/ifoundyoubytime?index_time={{ coordinate.now_time }}&telephone={{telephone}}">
                {{ coordinate.now_time }}
                {% if coordinate.now_time == index_time %}
                <i class="icon-tags"></i>
                {% endif %}
                </a></li>
                {% endfor %}
            </ul>
        </div>
        <div id="allmap" style="width:80%;height:480px;" class="span9">
        	<div style="width:500px;height=500px;"></div>
        	<!--img src="{{src}}" /-->
            {% if type == 1 %}
            	<script type="text/javascript">
				var map = new BMap.Map("allmap");
				map.centerAndZoom(new BMap.Point({{longitude}}, {{latitude}}), 17);
				var marker1 = new BMap.Marker(new BMap.Point({{longitude}}, {{latitude}}));
				map.addOverlay(marker1);
				var infoWindow1 = new BMap.InfoWindow("{{t_time}}时，我在这里！");
				marker1.addEventListener("click", function(){this.openInfoWindow(infoWindow1);});
				map.enableScrollWheelZoom();
				</script>
            {% else %}
            	<script type="text/javascript">
				var map = new BMap.Map("allmap");
				var point = new BMap.Point({{longitude}}, {{latitude}});
				map.centerAndZoom(point, 13);
				var polyline = new BMap.Polyline([
				{% for coordinatetime in coordinatetimes %}
					new BMap.Point({{coordinatetime.longitude}}, {{coordinatetime.latitude}}),
				{% endfor %}
				], {strokeColor:"red", strokeWeight:1, strokeOpacity:1});
				map.addOverlay(polyline);
				map.enableScrollWheelZoom();
				{% for coordinatetime in coordinatetimes %}
				var marker{{forloop.counter}} = new BMap.Marker(new BMap.Point({{coordinatetime.longitude}}, {{coordinatetime.latitude}}));
				map.addOverlay(marker{{forloop.counter}});
				var infoWindow{{forloop.counter}} = new BMap.InfoWindow("{{coordinatetime.current_time}}时，我在这里！");
				marker{{forloop.counter}}.addEventListener("click", function(){this.openInfoWindow(infoWindow{{forloop.counter}});});
				{% endfor %}
				</script>
            {% endif %}
        </div>
    </div>
</div>
</body>
{% include 'tail.html' %}
</html>
